package net.mysoft.budgetsoft.system.enumtype;

public enum SexEnum {
	
	MALE(1, "男"),
	FEMALE(2, "女");
	
	private int code;
	private String desc;
	private SexEnum(int code, String desc) {
		this.code = code;
		this.desc = desc;
	}
	public int getCode() {
		return code;
	}
	public void setCode(int code) {
		this.code = code;
	}
	public String getDesc() {
		return desc;
	}
	public void setDesc(String desc) {
		this.desc = desc;
	}
	
	public SexEnum getEnumByCode(int code) {
		SexEnum[] enums = SexEnum.values();
		for(SexEnum enumtype:enums) {
			if(code==enumtype.getCode()) {
				return enumtype;
			}
		}
		return null;
	}


}
